package com.example.sports_meet.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.fragment.app.Fragment;

import com.example.sports_meet.R;


public class TextFragment extends Fragment {

    private TextView textView;


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View root = inflater.inflate(R.layout.fragment_text, container, false);

        // 获取 TextView
        textView = root.findViewById(R.id.tv_text);

        // 获取传递过来的搜索结果，并显示在 TextView 中
        Bundle args = getArguments();
        if (args != null) {
            String result = args.getString("result");
            textView.setText(result);
        }

        return root;
    }
}
